import { createSlice } from '@reduxjs/toolkit'

export const counterSlice = createSlice({
    name: 'counter',
    initialState: {
        userInfo: null
    },
    reducers: {
        changeUserInfo: (state, action) => {
            state.userInfo = action.payload
        }
    }
})
// 每个 case reducer 函数会生成对应的 Action creators
export const { changeUserInfo } = counterSlice.actions

export default counterSlice.reducer